-- GENERATED SPELL FOR [Coilfang Sorceress] --


function spell0_17722(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(31581,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17722', 10000, 1)
end

function spell1_17722(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(39416,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17722', 10000, 1)
end

function spell2_17722(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15063,pUnit)
pUnit:RegisterEvent('Sorts_17722', 8251, 1)
end

function spell3_17722(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15531,pUnit)
pUnit:RegisterEvent('Sorts_17722', 8260, 1)
end

function spell4_17722(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(12675,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17722', 7000, 1)
end

function spell5_17722(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(37930,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17722', 7000, 1)
end

function Sorts_17722(pUnit, Event)
local choix_sorts_17722 = math.random(0, 5)
if choix_sorts_17722 == 0 then
pUnit:RegisterEvent('spell0_17722', 1, 1)
end
if choix_sorts_17722 == 1 then
pUnit:RegisterEvent('spell1_17722', 1, 1)
end
if choix_sorts_17722 == 2 then
pUnit:RegisterEvent('spell2_17722', 1, 1)
end
if choix_sorts_17722 == 3 then
pUnit:RegisterEvent('spell3_17722', 1, 1)
end
if choix_sorts_17722 == 4 then
pUnit:RegisterEvent('spell4_17722', 1, 1)
end
if choix_sorts_17722 == 5 then
pUnit:RegisterEvent('spell5_17722', 1, 1)
end
end

function mob17722_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17722', math.random(1500, 3000), 1)
end

function mob17722_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17722_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17722_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17722, 1, 'mob17722_Action')
RegisterUnitEvent(17722, 2, 'mob17722_Leave')
RegisterUnitEvent(17722, 3, 'mob17722_Kill')
RegisterUnitEvent(17722, 4, 'mob17722_Die')
